//
//  TotalViewController.m
//  FeiYang
//
//  Created by User on 15/10/10.
//  Copyright © 2015年 feiyang. All rights reserved.
//

#import "TotalViewController.h"
#import "HomePageViewController.h"
#import "ZYViewController.h"
#import "RecommendViewController.h"
#import "OwnerViewController.h"

@interface TotalViewController ()

@end

@implementation TotalViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    HomePageViewController *homePageViewCon = [[HomePageViewController alloc]init];
    homePageViewCon.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"首页"  image:[[UIImage imageNamed:@"tab_menu1_"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]selectedImage:[[UIImage imageNamed:@"tab_menu1_1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ]];
    
    ZYViewController *classViewCon = [[ZYViewController alloc]init];
    classViewCon.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"服务"  image:[[UIImage imageNamed:@"tab_menu3_"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tab_menu3_1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ]];
    
    RecommendViewController *offlineViewCon = [[RecommendViewController alloc]init];
    offlineViewCon.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"产品" image:[[UIImage imageNamed:@"tab_menu2_"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tab_menu2_1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    
    OwnerViewController *ownerViewCon = [[OwnerViewController alloc]init];
    ownerViewCon.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"我的"  image:[[UIImage imageNamed:@"tab_menu4_"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ]selectedImage:[[UIImage imageNamed:@"tab_menu4_1"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    
    self.viewControllers = @[homePageViewCon,offlineViewCon, classViewCon,ownerViewCon];
    
    UIView *backView = [[UIView alloc]initWithFrame:self.tabBar.bounds];
    backView.backgroundColor = [UIColor hexStringToColor:@"#f7f7f8"];
    [self.tabBar insertSubview:backView atIndex:0];
    self.tabBar.opaque = TRUE;

    [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor hexStringToColor:COLOR_VALUE]} forState:UIControlStateSelected];
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor hexStringToColor:@"#5a5a5a"]} forState:UIControlStateNormal];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
